package hibernate.xml34;


import junit.framework.TestCase;

import org.hibernate.Session;

public class InitData extends TestCase {

	public void testQuery(){
		Session session=null;
		try{
			session= HibernateUtil.getSession();
			session.beginTransaction();
			Inventory inv=new Inventory();
			inv.setItemNo(1001);
			inv.setItemName("m&s");
			inv.setQuantity(1000);
			session.save(inv);
			session.getTransaction().commit();
		}catch(Exception e){
			e.printStackTrace();
			session.getTransaction().rollback();
		}finally{
			HibernateUtil.closeSession(session);
		}
	}
}
